package com.mazaiting.redeye.module.feed

import com.chad.library.adapter.base.BaseQuickAdapter
import com.mazaiting.easy.app.IApplicationComponent
import com.mazaiting.easy.base.fragment.BaseRefreshFragment
import com.mazaiting.redeye.R
import com.mazaiting.redeye.base.ApplicationComponentImpl

/**
 * 图虫偏好列表 碎片
 */
class WormFragment : BaseRefreshFragment<WormPresenter>(), WormContract.View {
    override fun lazyFetchData() {
        presenter?.loadFeed()
    }

    override fun getContentLayout(): Int = R.layout.fragment_feed

    override fun inject(applicationComponent: IApplicationComponent?) {
        DaggerWormComponent
            .builder()
            .applicationComponentImpl(applicationComponent as ApplicationComponentImpl)
            .build()
            .inject(this)
    }

    override fun setAdapter(): BaseQuickAdapter<*, *> = WormAdapter()

    companion object {

        fun newInstance() = WormFragment()
    }
}
